package com.njworkorder.Service.Impl;

import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.njworkorder.Entity.AdministrativeOrganization;
import com.njworkorder.Entity.AdministrativePersonnel;
import com.njworkorder.Entity.RectificationNotice;
import com.njworkorder.Service.RectificationNoticeService;
import com.njworkorder.Mapper.RectificationNoticeMapper;
import com.njworkorder.VO.RectificationNoticeVo;
import org.springframework.stereotype.Service;

/**
* @author iron
* @description 针对表【rectification_notice】的数据库操作Service实现
* @createDate 2024-12-09 10:01:41
*/
@Service
public class RectificationNoticeServiceImpl extends MPJBaseServiceImpl<RectificationNoticeMapper, RectificationNotice>
    implements RectificationNoticeService{

    @Override
    public MPJLambdaWrapper<RectificationNotice> getMPJWrapper() {
        return new MPJLambdaWrapper<RectificationNotice>()
                .selectAll(RectificationNotice.class)
                .leftJoin(AdministrativeOrganization.class, AdministrativeOrganization::getId, RectificationNotice::getUnitAoId, ext ->
                        ext.selectAs(AdministrativeOrganization::getName, RectificationNoticeVo::getUnitName))
                .leftJoin(AdministrativePersonnel.class, AdministrativePersonnel::getId, RectificationNotice::getFounderApId, ext ->
                        ext.selectAs(AdministrativePersonnel::getName, RectificationNoticeVo::getFounderName))
                .leftJoin(AdministrativePersonnel.class, AdministrativePersonnel::getId, RectificationNotice::getRecipientApId, ext ->
                        ext.selectAs(AdministrativePersonnel::getName, RectificationNoticeVo::getRecipientName))
                .leftJoin(AdministrativePersonnel.class, AdministrativePersonnel::getId, RectificationNotice::getDirectorApId, ext ->
                        ext.selectAs(AdministrativePersonnel::getName, RectificationNoticeVo::getDirectorName));
    }
}




